package database

import (
	"blog/internal/models"
	"gorm.io/gorm"
	"log"
)

func AutoMigrations(db *gorm.DB) {
	err := db.AutoMigrate(
		&models.User{},
		&models.Profile{},
		&models.Article{},
		&models.ArticleTag{},
		&models.Attachment{},
		&models.Category{},
		&models.Content{},
		&models.Tag{},
	)
	if err != nil {
		log.Printf("error migrating users table: %v", err)
		return
	}
}
